<?php
$ArAvaliacoes = Dracosys::getSessionValue(SESSION_INTERFACE, 'AvaliacoesList');
$Setor = Dracosys::getSessionValue(SESSION_INTERFACE, 'SetorView');
$SectorEvaluation = Dracosys::getSessionValue(SESSION_INTERFACE, 'AvaliacaoSetor');
$ItOrdem = 0;
?>
<section id="EvaluationView">
    <?php if( !empty($ArAvaliacoes) ): ?>
        <section id="EvaluationView_MessageList">
            <header>
                <table class="TableInfo">
                    <thead>
                        <tr class="darkBlueGradient">
                            <th>SETOR</th>
                            <th>TOTAL</th>
                            <th>ÓTIMO</th>
                            <th>MUITO BOM</th>
                            <th>REGULAR</th>
                            <th>PÉSSIMO</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr class="lightblueGradient">
                            <td><?=$Setor->getStNome()?></td>
                            <td><?=$SectorEvaluation['TOTAL']?></td>
                            <td><?=$SectorEvaluation['OTIMO']?></td>
                            <td><?=$SectorEvaluation['MUITO BOM']?></td>
                            <td><?=$SectorEvaluation['REGULAR']?></td>
                            <td><?=$SectorEvaluation['PESSIMO']?></td>
                        </tr>
                    </tbody>
                </table>
            </header>
            <?php foreach($ArAvaliacoes as $Avaliacao):
                $ItOrdem++;
            ?>
                <section class="message">
                    <span class="messageType borderRadios avaliacao">Avaliacao</span>
                    <article id="EvaluationView_Message<?=$Avaliacao->getIDAvaliacao()?>">
                        <header class="borderRadios">
                            <span class="textTitle">Avaliacao:</span> <?=$ItOrdem?>
                            <span class="textTitle">Chamado:</span> #<?=$Avaliacao->getChamado()->getIDChamado()?>
                            <span class="textTitle">Cliente:</span> <?=$Avaliacao->getChamado()->getCliente()->getArIndividualData('StNome')?>
                            <span class="textTitle">Avaliado Como:</span> <?=$Avaliacao->getEnAvaliacao()?>
                            <a href="#" class="maximize" rel="Maximize_<?=$Avaliacao->getIDAvaliacao()?>"><img src="<?=DRA_VIEW_URL?>images/maximize.png" alt="Maximizar" /></a>
                            <a href="#" class="minimize" rel="Minimize_<?=$Avaliacao->getIDAvaliacao()?>"><img src="<?=DRA_VIEW_URL?>images/minimize.png" alt="Minimizar" /></a>
                        </header>
                        <p class="borderRadios"><?=$Avaliacao->getTxComentario()?></p>
                    </article>
                </section>
            <?php endforeach; ?>
        </section>
    <?php else: ?>
        <section id="Messages">
                <p class="Message">Este setor n&atilde;o possui nenhuma Avalia&ccedil;&atilde;o.</p>
        </section>
    <?php endif; ?>
</section>